 <!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>{$setting.webname}-班级管理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="/public/static/admin/layui/css/layui.css" rel="stylesheet">
    <link rel="shortcut icon" href="/public/static/favicon.ico"> <link href="/public/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/public/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/public/static/admin/css/animate.css" rel="stylesheet">
    <link href="/public/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/switchery/switchery.css" rel="stylesheet">
    <link href="/public/static/admin/css/plugins/datapicker/datepicker3.css" rel="stylesheet">

    <style>
	  .tools a i{
	    color:#19a9d5
	  }
	  .tools a i:hover{
	    text-shadow:0px 0px 5px #19a9d5;
	  }
	</style>

</head>

<body class="gray-bg">
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-sm-4">
            <h2>班级管理</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="{:url('Admins/admin')}">主页</a>
                </li>
                <li>
                    <strong>搜索班级</strong>
                </li>
            </ol>
        </div>
    </div>
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="row" style="margin-bottom: 20px">
                    <div class="col-sm-2">
                        <input type="text" placeholder="班级编号" id="classid" class="input form-control">
                    </div>
                    <div class="col-sm-2">
                        <select name="type" id="type" class="form-control">
                            <option value="">班级类型</option>
                            {foreach $classtype as $ks=>$vs}
                               <option value="{$vs.id}">{$vs.type_name}</option>
                            {/foreach}
                        </select>
                    </div>
                    <div class="col-sm-1">
                        <select name="status" id="status" class="form-control">
                            <option value="">班级状态</option>
                            <option value="1">待上课</option>
                            <option value="2">上课中</option>
                            <option value="3">已经毕业</option>
                        </select>
                    </div>
                    <div class="col-sm-1">
                        <input type="text" placeholder="老师" id="teacher" class="input form-control">
                    </div>
                    <div class="col-sm-1">
                        <input type="text" placeholder="添加者" id="author" class="input form-control">
                    </div>
                    <div class="col-sm-2 form-group" id="data_1">
                        <div class="input-group date" id="datepicker">
                            <span class="input-group-addon" ><i class="fa fa-calendar"></i></span>
                            <input type="text" class="form-control" value="" placeholder="开班时间" id="start_time">
                        </div>
                    </div>

                    <div class="col-sm-2 form-group" id="data_1">
                        <div class="input-group date" id="datepicker2">
                            <span class="input-group-addon" ><i class="fa fa-calendar"></i></span>
                            <input type="text" class="form-control" value="" placeholder="毕业时间" id="end_time">
                        </div>
                    </div>

                    <div class="col-sm-1">
                        <button type="button" class="btn btn btn-info" style="width: 100%" id="search"> <i class="fa fa-search"></i> 搜索</button>
                    </div>
                </div>
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>学生信息</h5>
                        <div class="ibox-tools tools">
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="table-responsive">
                            <table class="table table-striped">
                                <thead>
                                    <tr>
                                        <th>班级编号</th>
                                        <th>班级类型</th>
                                        <th>老师</th>
                                        <th>开班时间</th>
                                        <th>毕业时间</th>
                                        <th>添加者</th>
                                        <th>班级状态</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody id="datas">
                                    <tr>
                                        <td colspan="8">没有数据</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>

                    </div>
                </div>
            </div>

        </div>
    </div>

    <!-- 全局js -->
    <script src="/public/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/public/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- Peity -->
    <script src="/public/static/admin/js/plugins/peity/jquery.peity.min.js"></script>
    <!-- 自定义js -->
    <script src="/public/static/admin/js/content.js?v=1.0.0"></script>
    <!-- iCheck -->
    <script src="/public/static/admin/js/plugins/iCheck/icheck.min.js"></script>
    <!-- Switchery -->
    <script src="/public/static/admin/js/plugins/switchery/switchery.js"></script>
    <!-- Peity -->
    <script src="/public/static/admin/js/demo/peity-demo.js"></script>
    <script src="/public/static/admin/layui/layui.js"></script>
    <script src="/public/static/admin/js/plugins/prettyfile/bootstrap-prettyfile.js"></script>
    <!-- Data picker -->
    <script src="/public/static/admin/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <script>

        function updates(id){
            window.location.href = "{:url('Myclasss/update')}?id="+id;
        };

        $(function () {
            $("#datepicker").datepicker({
                language: "zh-CN",
                autoclose: true,//选中之后自动隐藏日期选择框
                clearBtn: true,//清除按钮
                todayBtn: false,//今日按钮
                format: "yyyy-mm-dd"//日期格式，
            });
            $("#datepicker2").datepicker({
                language: "zh-CN",
                autoclose: true,//选中之后自动隐藏日期选择框
                clearBtn: true,//清除按钮
                todayBtn: false,//今日按钮
                format: "yyyy-mm-dd"//日期格式，
            });
        });

        var del;
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
            //点击提交
            del = function (id,typeid){
                top.layer.msg('你确定要删除？', {
                    time: 20000, //20s后自动关闭
                    shade: 0.8,
                    btn: ['确定', '取消'],
                    btn1:function(){
                        $.post("{:url('Myclasss/deletes')}",{id:id,typeid:typeid},function(data){
                            top.layer.closeAll();
                            top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                                if(data.url){
                                    window.location.href = data.url;
                                }
                            });
                        });
                    }
                });
            }
            //查询内容
            $("#search").click(function(){
               $.post("{:url('Myclasss/toSearch')}",
                   {
                       classid: $("#classid").val(),          //班级编号
                       type:$("#type").val(),                   //班级类型
                       status:$("#status").val(),                   //班级类型
                       teacher:$("#teacher").val(),         //老师
                       author:$("#author").val(),          //添加者
                       "start_time":$("#start").val(), //开班时间
                       "end_time":$("#end").val(),         //毕业时间

                   }
                   ,function(data){
                   for(i in data){
                       console.log(i+"|"+data[i]);
                   }
                   if(data.code){
                       $("#datas").html(data.msg);
                   }else{
                       top.layer.closeAll();
                       top.layer.msg(data.msg,{time:2000,shade:0.5},function(){
                           if(data.url){
                               window.location.href = data.url;
                           }
                       });
                   }
               });
            });
        });
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
        });

    </script>

    
    

</body>

</html>
